package com.bw.liveplay.common.mvvm.viewmodel

import com.bw.liveplay.common.entity.BaseEntity
import com.bw.liveplay.common.entity.FocusEntity
import com.bw.liveplay.common.mvvm.adapter.FocusAdapter
import com.bw.liveplay.common.mvvm.mondel.FocusModel
import com.bw.liveplay.common.mvvm.mondel.TagListModel
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers

/**
 * @author KK
 * @description:
 * @date :2021/11/12 10:04
 *
 */
class FocusViewModel : BaseViewModel<FocusModel>() {
    public var adapter : FocusAdapter = FocusAdapter()
    override fun result(t: BaseEntity) {
        if(t is FocusEntity){
            var focusEntity = t as FocusEntity
            adapter!!.setNewInstance(focusEntity.data!!.data)
        }
    }

    override fun initData() {
        m.requestFocus(0,10,0,"onlyfollow",1)
            .observeOn(AndroidSchedulers.mainThread())
            .subscribeOn(Schedulers.io())
            .subscribe(this)
    }
}